///*
// * kheap.c
// *
// *  Created on: 19/12/2010
// *      Author: wendell
// */
//
//#include <paging.h>
//#include <kheap.h>
//
//// end is defined in the linker script.
//extern uint end;
//uint placement_address = (uint)&end;
//extern page_directory_t *kernel_directory;
////heap_t *kheap=0;
//
//uint kmalloc_int(uint sz, int align, uint *phys)
//{
//  if (align == 1 && (placement_address & 0xFFFFF000)) // If the address is not already page-aligned
//  {
//    // Align it.
//    placement_address &= 0xFFFFF000;
//    placement_address += 0x1000;
//  }
//  if (phys)
//  {
//    *phys = placement_address;
//  }
//  uint tmp = placement_address;
//  placement_address += sz;
//  return tmp;
//}
//
////Wrappers
//uint kmalloc_a(uint sz) {
//	return kmalloc_int(sz, 1, 0);
//}
//uint kmalloc_p(uint sz, uint *phys) {
//	return kmalloc_int(sz, 0, phys);
//}
//uint kmalloc_ap(uint sz, uint *phys) {
//	return kmalloc_int(sz, 1, phys);
//}
//uint kmalloc(uint sz) {
//	return kmalloc_int(sz, 0, 0);
//}

